<!-- * @Author yue.chen ( yue.chen2@hisoft.com ) -->
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Test Report</title>
		<style type="text/css"><![CDATA[
					.center {text-align: center}
					.leftTrue {text-align: left;background-color: #EEFFEE;}	
					.leftFalse {text-align: left;background-color: #FFCCFF;}
					.true {color: #000000;background-color: #EEFFEE;}
					.tag {color: #000000;background-color: #EEFFEB;text-align: center;}
					.tag2 {color: #000000;background-color: #EEFFEB;}
					.PASS {color: #000000;background-color: #EEFFEE;}
					.false {color: #000000;background-color: #FFCCFF;}
					.FAIL {color: #000000;background-color: #FFCCFF;}
					.falseCenter {color: #000000;background-color: #FFCCFF;text-align: center}
					.title {color: #9acd32}
					.spans {background-color: #CAE8EA;}
					.notdisplay {display:none;}
					.table{
						width:1200px;
					}
					.NOTRUN{color: #000000;background-color: #E6EBF9;}
					.stripe {background-color: #E6EBF9;text-align: center;}
					.bold{font-weight: bold;background-color: #9acd32}	
					th { 
						font: bold 14px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
						color: #4f6b72; 
						border-right: 1px solid #C1DAD7; 
						border-bottom: 1px solid #C1DAD7; 
						border-top: 1px solid #C1DAD7; 
						letter-spacing: 2px; 
						text-transform: uppercase; 
						text-align:center; 
						padding: 6px 6px 6px 12px; 
						background: #CAE8EA ; 
						word-wrap:break-word;
					}
					td { 
						font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
						border-top: 1px solid #C1DAD7; 
						border-left: 1px solid #C1DAD7; 
						border-right: 1px solid #C1DAD7; 
						border-bottom: 1px solid #C1DAD7; 
						padding: 6px 6px 6px 12px; 
					}
					#topNav {
						width: 1290px;
						float: left;
						display: block;
						z-index: 100;
						overflow: visible;
						position: fixed;
						top: 0px; 
						background-repeat: no-repeat;
						background-position: right;
						height: 21px;
					}
		]]></style>
	</head>
	<body>
		<div id="topNav">
			<br />
			<a href="#kanbudao" style="float:right;margin-right:10px;">back to top</a>
		</div>
		<a name="kanbudao" />
		<table class="table">
			<tr height="44px">
				<th colspan="6" width="100%">Environment</th>
			</tr>
			<tr>
				<th width="25%">site</th>
				<td width="25%">
					<xsl:value-of select="/Report/Configurations/BaseUrl" />
				</td>
				<th width="25%">Browser</th>
				<td width="25%">
					<xsl:value-of select="/Report/Configurations/Browser" />
				</td>
			</tr>
			<tr>
				<th>Host</th>
				<td>
					<xsl:value-of select="/Report/Configurations/Host" />
				</td>
				<th>Language</th>
				<td>
					<xsl:value-of select="/Report/Configurations/Language" />
				</td>
			</tr>
			<tr>
				<th>TestCasePath</th>
				<td>
					<xsl:value-of select="/Report/Configurations/TestCasePath" />
				</td>
				<th>PageDataPath</th>
				<td>
					<xsl:value-of select="/Report/Configurations/PageDataPath" />
				</td>
			</tr>
			<tr>
				<th>Port</th>
				<td>
					<xsl:value-of select="/Report/Configurations/Port" />
				</td>
				<th>os</th>
				<td>
					<xsl:value-of select="/Report/Configurations/OS" />
				</td>
			</tr>
			<tr>
				<th>LAN Speed</th>
				<td>
					<xsl:value-of select="/Report/Configurations/LANSpeed" />
				</td>
				<th>WAN Speed</th>
				<td>
					<xsl:value-of select="/Report/Configurations/WANSpeed" />
				</td>
			</tr>
			<tr colspan="2">
				<th>Site Speed</th>
				<td>
					<xsl:value-of select="/Report/Configurations/SiteSpeed" />
				</td>
			</tr>
		</table>
		<br />
		<table name="total" id="total" class="table">
			<tr height="44px">
				<th colspan="6" width="100%">
					Success/All
					<xsl:value-of select="/Report/TestcaseResult/@result" />
				</th>

			</tr>
			<tr class="title">
				<th>Test Name</th>
				<th>Operates Passed</th>
				<th># Failed</th>
				<th># Skipped</th>
				<th>Total Time(Secs)</th>
			</tr>
			<xsl:for-each select="Report/TestCases/TestCase">
				<xsl:choose>
					<xsl:when test="TestcaseResult/@failed='0'">
					</xsl:when>
					<xsl:otherwise>
						<tr class="center">
							<td class="leftTrue">
								<a href="#testcase{position()}">
									<xsl:value-of select="@fileName" />
									Version:
									<xsl:value-of select="@testCaseVersion" />
								</a>
							</td>
							<xsl:choose>
								<xsl:when test="TestcaseResult/passed='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@passed" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="true">
										<xsl:value-of select="TestcaseResult/@passed" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:choose>
								<xsl:when test="TestcaseResult/@failed='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@failed" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="false">
										<xsl:value-of select="TestcaseResult/@failed" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:choose>
								<xsl:when test="TestcaseResult/@skipped='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@skipped" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="none">
										<xsl:value-of select="TestcaseResult/@skipped" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<td>
								<xsl:value-of select="TestcaseResult/@totaltime" />
							</td>
						</tr>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
			<xsl:for-each select="Report/TestCases/TestCase">
				<xsl:choose>
					<xsl:when test="TestcaseResult/@failed='0'">
						<tr class="center">
							<td class="leftTrue">
								<a href="#testcase{position()}">
									<xsl:value-of select="@fileName" />
									(Version:
									<xsl:value-of select="@testCaseVersion" />
									)
								</a>
							</td>
							<xsl:choose>
								<xsl:when test="TestcaseResult/@passed='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@passed" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="true">
										<xsl:value-of select="TestcaseResult/@passed" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:choose>
								<xsl:when test="TestcaseResult/@failed='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@failed" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="false">
										<xsl:value-of select="TestcaseResult/@failed" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:choose>
								<xsl:when test="TestcaseResult/@skipped='0'">
									<td>
										<xsl:value-of select="TestcaseResult/@skipped" />
									</td>
								</xsl:when>
								<xsl:otherwise>
									<td class="none">
										<xsl:value-of select="TestcaseResult/@skipped" />
									</td>
								</xsl:otherwise>
							</xsl:choose>
							<td>
								<xsl:value-of select="TestcaseResult/@totaltime" />
							</td>
						</tr>
					</xsl:when>
				</xsl:choose>
			</xsl:for-each>

			<tr class="title">
				<th>Total</th>
				<th>
					<xsl:value-of select="/Report/TestcaseResult/@passed" />
				</th>
				<th>
					<xsl:value-of select="/Report/TestcaseResult/@failed" />
				</th>
				<th>
					<xsl:value-of select="/Report/TestcaseResult/@skipped" />
				</th>
				<th>
					<xsl:value-of select="/Report/TestcaseResult/@totaltime" />
				</th>
			</tr>
		</table>

		<br />
		<xsl:for-each select="Report/TestCases/TestCase">
			<table name="testcase" id="testcase" class="table">
				<tr height="44px">
					<th colspan="7" width="100%">
						<a name="testcase{position()}" />
						<xsl:value-of select="@fileName" />
						(Version:
						<xsl:value-of select="@testCaseVersion" />
						)
					</th>
				</tr>
				<tr>
					<td colspan="7" width="100%" class="spans">
						<span id="copy{position()}">
							Configuration(Automation):
							<br />
							Site:
							<xsl:value-of select="/Report/Configurations/BaseUrl" />
							2372/2.0.24
							<xsl:value-of select="/Report/Configurations/Time" />
							<br />
							OS:
							<xsl:value-of select="/Report/Configurations/OS" />
							<br />
							Language:
							<xsl:value-of select="/Report/Configurations/Language" />
							<br />
							Browser:
							<xsl:value-of select="/Report/Configurations/Browser" />
							<br />
							model name:
							<xsl:value-of select="@deviceModelName" />
							<br />
							mydlink NO:
							<xsl:value-of select="@deviceSN" />
							<br />
							MAC:
							<xsl:value-of select="@deviceMac" />
							<br />
							Firmware:
							<xsl:value-of select="@deviceFW" />
							<br />
							ID/PWD:
							<xsl:value-of select="@email" />
							/
							<xsl:value-of select="@password" />
							<br />
							Network Environment:
							<xsl:value-of select="@deviceConnectionType" />
							<br />
							Browser: TP-Link Model: TL-WR340G+
							<br />
							Device:
						</span>
						<p onclick="copyToClipBoard({position()})" style="cursor:pointer;float:right;margin-right:100px;">copy it</p>
					</td>
				</tr>
				<tr>
					<th width="5%">Line</th>
					<th width="12%" colspan="2">Tag</th>
					<th width="5%">Result</th>
					<th width="34%">Operate</th>
					<th width="34%">Operate Info</th>
					<th width="10%">Info</th>
				</tr>

				<xsl:for-each select="Tag">
					<xsl:choose>
						<xsl:when test="@name='Loop'">
							<xsl:for-each select="OperateInfo">
								<tr class="{@result}">
									<xsl:choose>
										<xsl:when test="position()='1'">
											<td class="center">
												<xsl:value-of select="@lineNumber" />
											</td>
											<td class="tag" rowspan="{@Count}">
												Loop
											</td>
											<td class="center">
												<xsl:value-of select="@name" />
											</td>
											<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
												<xsl:value-of select="@result" />
											</td>
											<td>
												<xsl:value-of select="@operate" />
											</td>
											<td>
												<xsl:value-of select="@resultInfo" />
											</td>
											<td>
												<xsl:value-of select="@info" />
											</td>
										</xsl:when>
										<xsl:otherwise>
											<td class="center">
												<xsl:value-of select="@lineNumber" />
											</td>
											<td class="center">
												<xsl:value-of select="@name" />
											</td>
											<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
												<xsl:value-of select="@result" />
											</td>
											<td>
												<xsl:value-of select="@operate" />
											</td>
											<td>
												<xsl:value-of select="@resultInfo" />
											</td>
											<td>
												<xsl:value-of select="@info" />
											</td>
										</xsl:otherwise>
									</xsl:choose>
								</tr>
							</xsl:for-each>
						</xsl:when>
						<xsl:otherwise>
							<xsl:choose>
								<xsl:when test="@name='ImportXML'">
									<xsl:for-each select="OperateInfo">
										<tr class="{@result}">
											<xsl:choose>
												<xsl:when test="position()='1'">
													<td class="center">
														<xsl:value-of select="@lineNumber" />
													</td>
													<td class="tag" rowspan="{@Count}">
														ImportXML
													</td>
													<td class="center">
														<xsl:value-of select="@name" />
													</td>
													<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
														<xsl:value-of select="@result" />
													</td>
													<td>
														<xsl:value-of select="@operate" />
													</td>
													<td>
														<xsl:value-of select="@resultInfo" />
													</td>
													<td>
														<xsl:value-of select="@info" />
													</td>
												</xsl:when>
												<xsl:otherwise>
													<td class="center">
														<xsl:value-of select="@lineNumber" />
													</td>
													<td class="center">
														<xsl:value-of select="@name" />
													</td>
													<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
														<xsl:value-of select="@result" />
													</td>
													<td>
														<xsl:value-of select="@operate" />
													</td>
													<td>
														<xsl:value-of select="@resultInfo" />
													</td>
													<td>
														<xsl:value-of select="@info" />
													</td>
												</xsl:otherwise>
											</xsl:choose>
										</tr>
									</xsl:for-each>
								</xsl:when>
								<xsl:otherwise>
									<xsl:choose>
										<xsl:when test="@name='Choose'">
											<xsl:for-each select="OperateInfo">
												<tr class="{@result}">
													<xsl:choose>
														<xsl:when test="position()='1'">
															<td class="tag">
																<xsl:value-of select="@lineNumber" />
															</td>
															<td class="tag" rowspan="{@Count}">
																Choose
															</td>
															<td class="tag">
																<xsl:value-of select="@name" />
															</td>
															<td class="tag" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
																<xsl:value-of select="@result" />
															</td>
															<td class="tag2">
																<xsl:value-of select="@operate" />
															</td>
															<td class="tag2">
																<xsl:value-of select="@resultInfo" />
															</td>
															<td class="tag2">
																<xsl:value-of select="@info" />
															</td>
														</xsl:when>
														<xsl:otherwise>
															<td class="center">
																<xsl:value-of select="@lineNumber" />
															</td>
															<td class="center">
																<xsl:value-of select="@name" />
															</td>
															<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
																<xsl:value-of select="@result" />
															</td>
															<td>
																<xsl:value-of select="@operate" />
															</td>
															<td>
																<xsl:value-of select="@resultInfo" />
															</td>
															<td>
																<xsl:value-of select="@info" />
															</td>
														</xsl:otherwise>
													</xsl:choose>
												</tr>
											</xsl:for-each>
										</xsl:when>
										<xsl:otherwise>
											<xsl:for-each select="OperateInfo">
												<tr class="{@result}">
													<td class="center">
														<xsl:value-of select="@lineNumber" />
													</td>
													<td class="center" colspan="2">
														<xsl:value-of select="@name" />
													</td>
													<td class="center" onclick="ImgShow('{@screenshot}')" style="cursor:pointer;">
														<xsl:value-of select="@result" />
													</td>
													<td>
														<xsl:value-of select="@operate" />
													</td>
													<td>
														<xsl:value-of select="@resultInfo" />
													</td>
													<td>
														<xsl:value-of select="@info" />
													</td>
												</tr>
											</xsl:for-each>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
			</table>
			<br />
		</xsl:for-each>
		<script language="javascript">
			var Sys = {};
			var ua =
			navigator.userAgent.toLowerCase();
			var s;
			(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
			(s = ua.match(/firefox\/([\d.]+)/)) ?
			Sys.firefox = s[1] :
			(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome =
			s[1] :
			(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
			(s =
			ua.match(/version\/([\d.]+).*safari/)) ?
			Sys.safari = s[1] : 0;
			function copyToClipBoard(id){
			var copyText =
			document.getElementById("copy"+id).innerText;
			if (Sys.ie){
			window.clipboardData.setData('Text',copyText);
			alert("Copy OK.");
			}else{
			alert("We are very sorry, Only support IE browser.");
			}
			}
		</script>
		<script type="text/javascript">
		<![CDATA[
			function ImgShow(imgPath){
			if(imgPath==''){
				return false;
			}
			if(confirm("online picture? or local one."))
  		 	{
      			imgPath= 'http://222.191.244.107:9998/picture/'+imgPath;
   			}
			var tagTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
			var tag=document.createElement("div");
				tag.style.cssText="width:100%;height:"+Math.max(document.body.clientHeight,document.body.offsetHeight,document.documentElement.clientHeight)+"px;position:absolute;background:black;top:0;filter: Alpha(Opacity=80);Opacity:0.8;";
				tag.ondblclick=closes;
			var tagImg=document.createElement("div");
				tagImg.style.cssText="font:12px /18px verdana;overflow:auto;text-align:center;position:absolute;width:200px;border:5px solid white;background:white;color:white;left:"+(parseInt(document.body.offsetWidth)/2-100)+"px;top:"+(document.documentElement.clientHeight/3+tagTop)+"px;"
				tagImg.innerHTML="<div style='padding:10px;background:#cccccc;border:1px solid white'><b style='color:#999999;font-weight:normal'>Image loading...</b><br /></div>";
				tagImg.oncontextmenu=function(){var clsOK=confirm("Click OK to close the image. \nIf you want to zoom pictures, please double-click on the picture."); if(clsOK){closes();};return false};
			var closeTag=document.createElement("div");
				closeTag.style.cssText="display:none;position:absolute;left:10px;top:-10px;color:black;";
				var closesHtml="<b style='background:green;border:1px solid white;filter:Alpha(Opacity=50);Opacity:0.5;cursor:pointer;'>&nbsp;close&nbsp;</b>";
				closeTag.innerHTML=closesHtml+" Tip: Double-click the image scaling";
				closeTag.onclick=closes;
			document.body.appendChild(tag);
			document.body.appendChild(tagImg);
			var img=new Image();
				img.src=imgPath;
				img.style.cssText="border:1px solid #cccccc;filter: Alpha(Opacity=0);Opacity:0;cursor:pointer";
			var barShow,imgTime;
			img.complete?ImgOK():img.onload=ImgOK;
			function ImgOK(){
				var Stop1=false,Stop2=false,temp=0;
				var tx=tagImg.offsetWidth,ty=tagImg.offsetHeight;
				var ix=img.width,iy=img.height;
				var sx=document.documentElement.clientWidth,sy=window.innerHeight||document.documentElement.clientHeight;
				if(iy>sy||ix>sx){
						var yy=sy-100;
						var xx=(ix/iy)*yy;
				}else{
					var xx=ix+4;
					var yy=iy+3;
				}
					img.style.width=xx-4+'px';
					img.style.height=yy-3+'px';
				if(ix<sx&&iy<sy){tagImg.alt="";closeTag.innerHTML=closesHtml;};
				var maxTime=setInterval(function(){
					temp+=35;
					if((tx+temp)<xx){
						tagImg.style.width=(tx+temp)+"px";
						tagImg.style.left=(sx-(tx+temp))/2+"px";
					}else{
						Stop1=true;
						tagImg.style.width=xx+"px";
						tagImg.style.left=(sx-xx)/2+"px";
					}
					if((ty+temp)<yy){
						tagImg.style.height=(ty+temp)+"px";
						tagImg.style.top=(tagTop+((sy-(ty+temp))/2))+"px";
					}else{
						Stop2=true;
						tagImg.style.height=yy+"px";
						tagImg.style.top=(tagTop+((sy-yy)/2))+"px";
					}
					if(Stop1&&Stop2){
						clearInterval(maxTime);
						tagImg.appendChild(img);
						temp=0;
						imgOPacity();
					}
				},30);
				function imgOPacity(){
					temp+=10;
					img.style.filter="alpha(opacity="+temp+")";
					img.style.opacity=temp/100;
					imgTime=setTimeout(imgOPacity,1)
					if(temp>100) clearTimeout(imgTime);
				}
				tagImg.innerHTML="";
				tagImg.appendChild(closeTag);

				if(ix>xx||iy>yy){
					img.alt="Left click and move, double-click to zoom";
					img.ondblclick=function (){
						if(tagImg.offsetWidth<img.offsetWidth||tagImg.offsetHeight<img.offsetHeight){
							img.style.width="auto";
							img.style.height="100%";
							img.alt="double-click to zoom";
							img.onmousedown=null;
							closeTag.style.top="10px";
							closeTag.style.left="10px";
							tagImg.style.overflow="visible";
							tagImg.style.width=img.offsetWidth+"px";
							tagImg.style.left=((sx-img.offsetWidth)/2)+"px";
						}else{
							img.style.width=ix+"px";
							img.style.height=iy+"px";
							img.alt="Double-click to shrink";
							img.onmousedown=dragDown;
							tagImg.style.overflow="auto";
							tagImg.style.width=(ix<sx-100?ix+20:sx-100)+"px";
							tagImg.style.left=((sx-(ix<sx-100?ix+20:sx-100))/2)+"px";
						}
					}
					img.onmousedown=dragDown;
					tagImg.onmousemove=barHidden;
					tagImg.onmouseout=moveStop;
					document.onmouseup=moveStop;
				}else{
					tagImg.style.overflow="visible";
					tagImg.onmousemove=barHidden;
				}
			}
			function dragDown(a){
				img.style.cursor="move";
				var evts=a||window.event;
				var onx=evts.clientX,ony=evts.clientY;
				var sox=tagImg.scrollLeft,soy=tagImg.scrollTop;
				var sow=img.width+2-tagImg.clientWidth,soh=img.height+2-tagImg.clientHeight;
				var xxleft,yytop;
				document.onmousemove=function(e){
					var evt=e||window.event;
					xxleft=sox-(evt.clientX-onx)<0?"0":sox-(evt.clientX-onx)>sow?sow:sox-(evt.clientX-onx);
					yytop=soy-(evt.clientY-ony)<0?"0":soy-(evt.clientY-ony)>soh?soh:soy-(evt.clientY-ony);
					tagImg.scrollTop=yytop;
					tagImg.scrollLeft=xxleft;
					closeTag.style.top=(yytop+10)+"px";
					closeTag.style.left=(xxleft+10)+"px";
					return false;
				}
				return false;
			}
			function barHidden(){
				clearTimeout(barShow);
				closeTag.style.top=(tagImg.scrollTop+10)+"px";
				closeTag.style.left=(tagImg.scrollLeft+10)+"px";
				if(closeTag.style.display=="none")closeTag.style.display="block";
				barShow=setTimeout(function(){closeTag.style.display="none";},1000);
			}
			function closes(){
				document.body.removeChild(tag);
				document.body.removeChild(tagImg);
				clearTimeout(barShow);
				clearTimeout(imgTime);
				document.onmouseup=null;
				tag=img=tagImg=closeTag=null;
			}
			function moveStop(){
				document.onmousemove=null;
				tagImg.onmousemove=barHidden;
				img.style.cursor="pointer";
			}
		}
		]]>
		</script>
	</body>
</html>
